converted manual updates into bash array loop