Solution to #3-4