Move these checks to declaration of the array values. Use Real(0.0).