Made some changes so that the main function is cleaner. Once file output is more structured, I'll add one or two example files