Added header comments to all functions and minor cleanup.
Merge branch 'improve_documentation' into develop