commenting and minor fixes