changed color mapping
tidy code