fix merge sort counting