Debugged moment calculator