Does anyone else find approach #3 to be wildly unintuitive? Like how does an infinite loop terminate? There's a lot of magic going on.<p>I like approach #1 the best. Sure, there are some bugs, but a state diagram would help make it clearer instead of introducing magic.