added comments for some code