Bug correction

Moment gathering was done twice. Unnecessary code has been removed from the CalculateFields function.