refactored vector stuff