updated documentation, code fixes