finished ex2-8, challenge 2