please, avoid such loops and use transposition as in the minimize() method.