fixing moment calculations