exercise 3-5: list manipulation