Started seperating the code in to a modular structure. Currently bugged