modularize debounce
modularize and rename
many comments added
modularization finished - testing pending
tested and working