Added the code for the two functions.