Implemented MergeSort for array