made a working version of map.