Added a potential solution to problem 1.