improced vector class. The dimensions are generic.