Minor fixes. Redundancy removed. Code documentation added.