Added documentation for all functions.