added comments on the code