Using `std::vector<>::at()` instead of [] will check bounds, it should be much safer.