Loop instead of while.