chapter 8, version 2 (without full tables)