Implemented map with tests.