Finished the multiway merge exercise