changes passed valgrind