Added comments in areas I thought needed an explanation.