implemented dot product functionality and tests