DOC: added function documentation
MAINT: fixed error in last commit
TST: expanded tests