first two functions complete.