Eliminated redundancy

Rewrote description, added some comments and eliminated some redundancy
in the programing.