before change to remove temp array
going to remove temp array
working version of mergesort with temp array