adding tests and valgrind output