started using valgrind to correct three years of leaky code...