added test and docs