Amended too cater for a larger number of ways to input LP variables.