Added docs and tests