Style improvements
Changed ExpectationSum to a private class