You always remove your debug prints? "2>/dev/null" is the new #define NDEBUG! Seriously, it bugs me a bit when someone posts blatantly broken code prefaced by a bunch of monk-placating boilerplate. It shows that the OP has learned the wrong things from reading the site.