Trying to work with Custom UI Elements and revising the code.