Changed coloring function