Add solution to 3; formatting changes.