Trying to figure out sorted-flat simplification