Added code for two functions