added the two functions