function that modifies the keys in a map