 
         for(var i:int = 0; i < subStepCount; ++i) {
             var normalForce:Number          = (carMass + wheelMass) * gravity;
-            var staticLimit:Number          = 0.8 * normalForce * coefSF;
+            var tireStaticLimit:Number      = staticForceRatio * normalForce * coefSF;
 
             var appliedTorque:Number        = wheelTorque * throttle * direction;
             var torqueForce:Number          = -appliedTorque / wheelRadius;

        throw new Error("slip ratio not found?");
    }

    private function getKineticForceRatio(slipRatio:Number, dir:Number):Number {
        var sr:Number = Math.abs(slipRatio);

        if(sr == 0)
            if(! sameSign(-dir, slipRatio, true))
                return 0.0;
            else
                return 0.8;

        if(sr <= 0.1)
            if(! sameSign(-dir, slipRatio, false))
                return sign(slipRatio) * (sr / 0.1);
            else
                return sign(slipRatio) * (0.8 + 0.2 * (sr / 0.1));

        if(sr <= 0.3)
            return sign(slipRatio) * (1 + 0.2 * ((0.1 - sr) / (0.3 - 0.1)));

        if(sr <= 1)
            return sign(slipRatio) * (0.8 + 0.2 * ((0.3 - sr) / (1 - 0.3)));

        return sign(slipRatio) * 0.6;
    }
}
}

            airDragTorque                   = -airDragForce * wheelRadius;
            rollingDragForce                = dragForceSign * coefRollingDrag * normalForce;
            rollingDragTorque               = -rollingDragForce * wheelRadius;
            totalDragForce                  = rollingDragForce;
            totalDragTorque                 = rollingDragTorque;

            // Total forces acting on the body, not created by the tire.
            // It transfers onto a tire (and from the tire back onto the body) up to a static limit. The excess force
            // does not make the tire spin more, but still acts on the body (changing the acceleration)
            var bodyTotalForce:Number       = airDragForce;
            var bodyStaticForce:Number      = Math.abs(bodyTotalForce) > tireStaticLimit ? sign(bodyTotalForce) * tireStaticLimit : bodyTotalForce;
            var bodyExcessForce:Number      = bodyTotalForce - bodyStaticForce;

            // TODO: edit this
            // A tire has a tireStaticLimit, which is how much force can it transfer without slipping - this is
            // described by tireStaticForce. If it slips just a little bit, it can transfer even more force, but
            // if it stats to slip too much, it'll go below its tireStaticLimit. This is described by tireKineticLimit.
            // Any force over tireStaticLimit but below tireKineticLimit accelerates the body and decelerates the wheel
            // (it creates a kinetic force pushing body forward and a torque which tries to slow down the wheel).
            // Anything above tireKineticLimit contributes only to increasing tire slip (which will in turn contribute
            // to changing the tireKineticLimit in the next iteration) - this is stored as tireExcessForce.
            // First, we calculate the tireStaticForce and tireExcessForce. Then the currently available tireKineticLimit
            // and using it we calculate tireKineticForce and eventually decrease tireExcessForce (some of it might increase
            // the tireKineticForce - all depending on the tireKineticLimit available).
            var tireTotalForce:Number   = torqueForce + brakingForce + bodyStaticForce + totalDragForce;
            var tireStaticForce:Number  = Math.abs(tireTotalForce) > tireStaticLimit ? sign(tireTotalForce) * tireStaticLimit : tireTotalForce;
            var tireExcessForce:Number  = tireTotalForce - tireStaticForce;

            var surfaceVel:Number       = wheelPosVel + wheelAngVel * wheelRadius;
            var tireKineticLimit:Number = -sign(surfaceVel) * getKineticForceRatio(slipRatio) * normalForce * coefSF;
            var tireKineticForce:Number;

            // static friction only
            if(tireKineticLimit == 0) {
                tireKineticForce = 0;
            }
            // kinetic friction, kinetic force pushes the opposite direction (or static force is 0)
            else if(! sameSign(tireStaticForce, tireKineticLimit, false)) {
                tireKineticForce = tireKineticLimit;
            }
            // kinetic friction, both forces push the same direction
            else {
                // slip ratio at or about to reach its optimum
                if(Math.abs(slipRatio) <= kineticPeakSlipRatio) {
                    var maxKineticLimit:Number  = getKineticForceRatio(sign(slipRatio) * kineticPeakSlipRatio) * normalForce * coefSF;
                    var boostRatio:Number       = tireKineticLimit / maxKineticLimit;
                    var kineticBoostLeft:Number = maxKineticLimit - tireStaticForce;

                    tireKineticForce                = kineticBoostLeft * boostRatio;
                    tireExcessForce                -= tireKineticForce;

                    // was all excess force used up
                    if(sign(maxKineticLimit) * tireExcessForce < 0)
                        tireExcessForce = 0;
                }
                // sub-optimal slip, past the optimum
                else {
                    tireKineticForce = tireKineticLimit - tireStaticForce;

                    // static force higher than kinetic limit
                    if(sign(tireKineticLimit) * tireKineticForce < 0) {
                        tireStaticForce    -= sign(tireKineticLimit) * tireKineticForce;
                        tireExcessForce    += sign(tireKineticLimit) * tireKineticForce;
                        tireKineticForce    = 0;
                    }
                    else {
                        tireExcessForce    -= sign(tireKineticLimit) * tireKineticForce;

                        // was all excess force used up
                        if(sign(tireKineticLimit) * tireExcessForce < 0)
                            tireExcessForce = 0;
                    }
                }
            }

            // compute longitudinal and angular accelerations based on tireStaticForce (no slipping)
            var acc:Number      = tireStaticForce / (carMass + wheelMass);
            var angAcc:Number   = -acc / wheelRadius;

            // add bodyExcessForce (like huge air resistance, e.g. wind)
            acc                += bodyExcessForce / (carMass + wheelMass);

            // add tireKineticForce to both - acc increases, angAcc decreases
            acc                += tireKineticForce / (carMass + wheelMass);
            angAcc             += tireKineticForce * wheelRadius / wheelInertia;

            // finally add tireExcessForce to increase angular acceleration
            angAcc             += -tireExcessForce * wheelRadius / wheelInertia;

            //compute new velocities
            var oldPosVel:Number = wheelPosVel;
