Added the two functions as required.