implemented cleaner merge sort