added ability to write graphic map, some other changes