Iterative reducing the dot product of two vectors. need to debug