Added reductions, proper inner product.