Finished problem 4.5 (merge sort implementation)