converted debounce to use RAF if desired