Added code to operate the button.
changed debounce interval
tidy up