Sort lines by first y point when initializing data structure for distrubution sweeping