More documentation and comments