Made debug logging work, added debounce routine