add a coloring funciton and a sorting funciton