implemented map functionality