Finished and debugged first version of merge sort.