simpler while loop