Created the two functions requested