p234. this works, but i'm not sure how to bound the iteration to stop when an optimal solution has been found. will work on this tomorrow after zzz