NP-solution codepath in place. solves problem 4, hangs on problem 3