Merger sort algorithm