Added a lot of comments.