Added commenting to all the code