Added count variables for debouncing