fixed max_nvariance method