added nonblocking software debounce because hardware debounce didn't
work.