use valgrind to fix all memory leaks