Solution to #3-8