Changed at(i) to [i] for vectors