should be < not <= for zero start array