added documentation of function.