coloring function was overcomplicated