Commenting and Formatting

Updated to include per-function formatted comments detailing
inputs/outputs/functionality.