outside loop