Fixed bug in solution.