added comments for helpfucntions