Changed coloring code to take it easy on the CPU