Maintain step numbers after sorting by date