Changes to code with more comments