added fixed map function