automated determination of 1D or 2D case