modified to solve for the problem set
modified to solve the problem not the sample problem.