Optimising the until block

Suggested by walter bender