optimizing list length calcs
inlining the recursive merge sort calls
using the list extend method to add remaining elements instead of iterating over each element and appending