integrating debounce alghorithm added