Updated documentation and comments