refactored ch04q06