read in map function