Move coloring function outside of map render function; comments