First version of applyTorque function.