docs and some tests