map function implemented