The map function in terms of reduce