Finished mergeksortedlist function