Solution to #3-7