refactored tests, ch 3.5, ex 2