Complete the missing functions.

As per instructions on Assignment 2.