Finish the two functions