might have written the dynamics calculation function incorrectly