exercise 5.4 forAll implemented