run concurrently with goroutine
allow minDim and maxDim to be equal