fill out the two functions according to the instructions