debugged dot product