writing write_to_map.m