HW7: Create the following functions