exercise 2.34 horner's alogrithm