needless parameterization, startIdx should always be of type size_t.