finally implemented vector class