Finished sorted_points.c - needs testing