Changed bounds checking