implemented map method.