p 170 with recursion