commenting and minor code changes