passed all tests with Valgrind