added docs and tests