Comments and debouncing added.