challenge 14: segment sorting works