some refactoring, vector class added