chapter 8 completed, some error with recursion