adds functional map, but this version isn't very performant due to iterating over bounded ranges