Added commenting to code