while ( and !$flag){} #UPDATE---see below discussion!