Addedd optional formatting for ouput file. Still a work in progress and it formats to my personal preference