Adds documentation.

Adds documentation to the functions.
Fixes typo.

Fixes typo in the javadoc.