small adjustments to dot-product; basic sage ready