Added class code and debounce code