fixed small bug in dynamics