add comments, minor fixes