Make it more obvious which condtion fails.
Replace the cheesy sleep-loop with a proper cond-var.