Please dont use ASSERT but REQUIRE with some meaningful error message giving the index and its bound