works for any vector size