Changes to calcFactors, more safety checks