SORTING: color sorting works, now I should refactor