convert vector to array
add dot product