fixing multiple bugs

* fixing button press duration bugs, which resulting in unwanted
behaviour
* cleaning up some lines