added save_map and minor change