refactored Vector class