Added code to both functions. Tested the code and it works as expected.