added support for a map function