added some comments on code