adds a few more things to main, and moves the 'other' functions into separate files