Completing the assignment

Fill up the content of the two required functions