added map function from functional programming