implement two functions.