Added index bounds checking
Moved