Refactored, Corrected function names
Refactored, removed redundant comments