updated coloring algorithm again.