In mergeSort: initialize variables outside the function call instead of inside