Added documentation for functions