update docs and add tests