Updated comments.
Added comments and did some cleaning.
Added comments and tidied some things up.