Added the contents of both functions and verified they work