implements and satisfies test for exercise 10