Finalized the code and seperated it into it's own module and file