Fixed optimisation issues, finetuned button debouncing