Update: Code Cleanup

Moved prototypes to header file

Documented and commented source code