Project 4, Problem 1 solution.