updated docs and code