make samedims be conditional