Added two functions to the code.