shortened while loop