M sort