fix bad comments, minor code improvement