for now, I am making `checkIndexBounds` non-static (to use fail()), maybe we can it along with all the other helpers.