added function documentation