chapter 13.1-13.5, ch 10 factorial bugfix