made comments and changes to code