adapted to use foreach

From changes by Michael Benesty.
updated LPH07_1 to use all binary variables