created body of both functions