a bunch of changes to the structure, also added some more file io
helpers