Fleshed out the body of both functions