inlucded groupImproved from Code Review (StackExchange) and fixed MergeSort per help from Code Review