made rainbow coloring more efficient