build vector correctly