Finished the second question in the assignment.