exercise: create a map method