reorder args in write_maps for consistency