Added Expectation function.