Update #15

Moved alot of code to methods