Solution to #2-9