changed from map function in the code to a map function from a design document