Updated to include optimal solution printout.