Updated commenting and removed unnecessary code