functions created and working