Added some documentation for functions