added some logic to test the button debouncing