added comments

explaining some lines of code