new DEBOUNCE algorithm