added proposed solution to problem 2