I am coding the Merge sort algorithm but somehow got stuck with a problem. The problem is that I need to use the return value of the merge function as an argument as an previous recursive call of the same merge function. Sorry for not being clear.

Here is my code:

```py
a = [10,5,2,20,-50,30]

def mergeSort(arr):
   l = 0
   h = len(arr)-1
   if h > l:
      mid = (l+h) // 2
      left = arr[l:mid+1]
      right = arr[mid+1:]
      mergeSort(left)
      mergeSort(right)
      merge(left, right)

def merge(l, r):
   subarr = []
   lc = 0
   rc = 0
   loop = True
   while loop:
      if lc > len(l)-1 and rc <= len(r)-1:
         for i in range(rc, len(r)):
            subarr.append(r[i])
            loop = False
      elif lc <= len(l)-1 and rc > len(r)-1:
         for i in range(lc, len(l)):
            subarr.append(l[i])
            loop = False
      elif l[lc] < r[rc]:
         subarr.append(l[lc])
         lc += 1
         loop = True
      elif r[rc] < l[lc]:
         subarr.append(r[rc])
         rc += 1
         loop = True
      elif l[lc] == r[rc]:
         subarr.append(l[lc])
         subarr.append(r[rc])
         lc += 1
         rc += 1
         loop = True    

mergeSort(a)

```

Any help will be appreciated thank you :)