Added initial setup of paths to main aswell as refactored some of the code in main.