added some docs and tests