Added comments with the basic descriptions.

Also made some minor changes in the code: changed two
variable names and removed a duplicated attribute.