Added some comments to the ugly stateful code to make it less obscure, but probably it didn't help ;)
Added basic on screen control buttons.