Added a map function