Clean up problem 1 solution a bit.