update docs, add some tests