implemented polymorphic map method