updated for a large number of integer variables