new logic for getNumOfVariableCols()