added comments inside functions