base code for the DotProduct

feel free to modify