added comments in functions