Commit with recent changes in regards to adding a function for outputting debug, removing debug info and switching around some of the code in response to Tulonsae's comments