add correct commenting to toPositionSortedArray function