Wrote problem 1e 1f.