Made sure crossSectionY didn't go out of bounds of the array.