Added some documentation/comments

Made understanding the outputting process easier