Refactored code into a new method and also started to code the onclick method. So far so good.