added more coloring logic