I think that you need to think a little more about the design of your Vector class. You need to decide upon a minimal but complete interface for Vector. It looks like you could do with some member variables instead of creating local variables named size and degree