working LP Solver for Problem 1