Added some comments.
Added documentation.