Filled in body of the 2 function stubs provided by the course instructor.