better documentation and comments