Implement bounds checking