exercise 2.68 encode-symbol