bounds checking

bounds checking