added tests and merge sort