Filled in the content of two functions

Assignments finished, only need to add comments