Getting closer to the sorting to work