Lesson 11: Moment calculation scalar formulation