Sometimes quickly touching the screen with two fingers will result in the firmware thinking one finger moved very quickly. This code tries to identify the difference between the two based on velocity of the last N points versus the velocity of the last M points and figure out if there was mostly acceleration or a sudden deceleration. It's still not perfect and very dependent on the touch hardware.