renamed * to dotProd and changed the types a bit