minor changes to code and comments