Debounce refactored to use ints for compare