Use "until" instead of "loop do"