removed printf stuff and all know leaks with valgrind