def merge_sort(m):
    l = [[x] for x in m]
while len(l) > 1:
    for x in range(len(l) >> 1):
        l[x] = merge(l[x], l.pop())
return l[0] if len(l) else []
alternative to recursion based merge sort logic