added comments on functions