Changing order of arguments for map and reduce