Added documentation for several functions