fixed some code and comments