Implement Map() function.