Refactored and almost finished vector type