completed both functions.