updated docs and comments