Solution to #2-8