changes to the function MapColor

added three new arguments