Implementation of map() corrected.  Unit tests for map() added.