add docs and tests