fixed column counting bug, added potential code for min iteration to threshold =1