vector class should be immutable