Adding code to complete the assignment.