small bug repaired in momentum generation