mergesort working, and passing valgrind