improved button software debouncing