Actually, I don't think you need this vector at all; it only seems to exist so that you can find the maximum element in it. Why construct it in the first place?