use vector firstElement() rather than get(0)