Fixed Problem 12 Solution Code