initial import of map code from almossawi