added documentation for functions