changes to ComputeDotproduct