setDim should take a size_t instead