Refreshed comments on code.
Refactored to increase modularity.
Refactored to increase modularity.