Add docs and comments