Wrapped coloring to fix input bug