Added most of the comments.
Fixed spacing and indent (4 spaces).