Merge sorting again as the previous program was wrong