tweak documentation, add tests