add some comments, minor fixes