some changes in code and comments