Added NaN removal