Better documentation and comments