added at() function that throws std::out_of_range error