Bike in unity

So I am creating a slight story driven sandbox for a project and am having trouble with a key element which is a motorbike where I have a script that controls the movement of the motorbike using the new input system and it accelerates just fine however steering is a problem in which it will occasionally just turn in one random direction and change direction so on so forth it also will resist and sometimes even turn in the opposite direction to the input and have no clue why i posted about it before and got an answer of it due to only having one wheel collider for front and one for back so i tried 2 and it didnt help so im thinking of creating the script from scratch again and taking a different approach hopeully still with wheel colliders but i have no idea where to start other than what i had originally so i thought id ask here is there any good sources for reading about this what should be some of the things i should do stuff like that if it help heres the controller code i have that is set up for 2 wheel colliders for 2 wheels teh one per wheel was similar just didnt have the torque halved over both wheels is there anything from this i should keep or change i am especially wanting to redo the stalling and rpm system as it is not consistant and is just a hassle i may just even scrap it i also created a custom wheel class as i thought i would need to extend teh wheel colliders with some methods of my own later but im gonna remove this aswell as i dont need to have this

public class MotorbikeController : MonoBehaviour
{
[SerializeField] private Wheel frontWheelColliders;
[SerializeField] private Wheel rearWheelColliders;
[SerializeField] private float maxMotorTorque;
[SerializeField] private float reverseTorque;
[SerializeField] private float brakeTorque;
[SerializeField] private float steeringAngle;
[SerializeField] private float stallLimit = 60500;
[Range(1f, 10f)]
[SerializeField] private float revConstant;

public int gear;

private InputManager.MotorbikeActions controls;
private float motorTorque;
private float RPM;
private Dictionary<int, float> gearToRatio = new Dictionary<int, float>();
private bool stalled;
public bool engineRunning;

private float highestRPM = 0f;
private float highestWheelRPM = 0f;
private float highestMotorTorque = 0f;
private int gearBefore;

private void highest() // for debugging perposes just displays teh highest rpm reached when i end play using OnApplicationQuit()
{
    if (RPM > highestRPM)
    {
        highestRPM = RPM;
    }
    if (rearWheelColliders[0].RPM() > highestWheelRPM)
    {
        highestWheelRPM = rearWheelColliders[0].RPM();
    }
    if (rearWheelColliders[0].GetMotorTorque() * 2 > highestMotorTorque)
    {
        highestMotorTorque = rearWheelColliders[0].GetMotorTorque() * 2;
    }
}

private void OnApplicationQuit()
{
    Debug.Log(highestRPM);
    Debug.Log(string.Concat("highest wheel rpm", highestWheelRPM));
    Debug.Log(string.Concat("highest motor torque", highestMotorTorque));
}

// Start is called before the first frame update
void Start()
{
    controls = SceneController.instance.inputManager.Motorbike;
    controls.Enable();
    InputManager.PlayerActions playerControls = SceneController.instance.inputManager.Player;
    playerControls.Disable();
    gear = 0;
    engineRunning = false;
    populateGearToRatio();
}

private void populateGearToRatio() // add values to teh gear ratio dictionary to refrence when checking if stalling
{
    gearToRatio.Add(1, 3.5f / 4.5f);
    gearToRatio.Add(2, 2.5f / 3.5f);
    gearToRatio.Add(3, 1.8f / 2.8f);
    gearToRatio.Add(4, 1.2f / 2.2f);
    gearToRatio.Add(5, 0.9f / 1.9f);
    gearToRatio.Add(6, 0.2f / 1.2f);
}

// Update is called once per frame
void Update()
{
    
}

void FixedUpdate()
{
    if (controls.Ignition.IsPressed()) // ignition toggling
    {
        engineRunning = true;
    }
    float horizontalInput = controls.Move.ReadValue<Vector2>().x;  // input converted from vector
    float verticalInput = controls.Move.ReadValue<Vector2>().y;

    frontWheelColliders[0].SetStearAngle(steeringAngle * horizontalInput);
    if (engineRunning && !controls.Clutch.IsInProgress() && !stalled)
    {
        rearWheelColliders[0].SetMotorTorque((motorTorque * verticalInput) / 2);  // accelerates teh bike using motor toruqe of the wheel
        rearWheelColliders[1].SetMotorTorque((motorTorque * verticalInput) / 2);
        RPMCalculations();  //calculates rpm
        StallCheck();
    }
    else
    {
        rearWheelColliders[0].SetMotorTorque(0f);
        rearWheelColliders[1].SetMotorTorque(0f);
    }
    Shifting();
    ShiftingChangeChecks();
    Breaking();
    highest();
}

private void Breaking() // similar with teh accelerating just using brake torque
{
    if (controls.BreakRear.IsPressed())
    {
        rearWheelColliders[0].SetBreakTorque(brakeTorque / 2);
        rearWheelColliders[1].SetBreakTorque(brakeTorque / 2);
    }
    else
    {
        rearWheelColliders[0].SetBreakTorque(0f);
        rearWheelColliders[1].SetBreakTorque(0f);
    }
    if (controls.BreakFront.IsPressed())
    {
        frontWheelColliders[0].SetBreakTorque(brakeTorque / 2);
        frontWheelColliders[1].SetBreakTorque(brakeTorque / 2);
    }
    else
    {
        frontWheelColliders[0].SetBreakTorque(0f);
        frontWheelColliders[1].SetBreakTorque(0f);
    }
}

private void Shifting() //handles what gear the bike is in and when its shifted
{
    if (controls.Clutch.IsInProgress())
    {
        if (controls.ShiftUp.WasPressedThisFrame() && gear <= 6 && gear >= 0)
        {
            gearBefore = gear;
            ChangeGear(1);
        }
        else if (controls.ShiftDown.WasPressedThisFrame() && gear >= 0 && gear <= 6)
        {
            gearBefore = gear;
            ChangeGear(-1);
        }
        gear = Mathf.Clamp(gear, 0, 6);
    }
}

private void ChangeGear(int shiftValue)
{
    gear += shiftValue;
    if (gear > gearBefore + 1 || gear < gearBefore - 1)
    {
        gear += -shiftValue;
    }
}

private void ShiftingChangeChecks() // sets teh max speed you can reach in each gear       //want to make more fluid 
{
    if (gear == 0)
    {
        motorTorque = 0f;
    }
    else if (gear == 1)
    {
        motorTorque = maxMotorTorque / 6;
    }
    else if (gear == 2)
    {
        motorTorque = 2 * (maxMotorTorque / 6);
    }
    else if (gear == 3)
    {
        motorTorque = 3 * (maxMotorTorque / 6);
    }
    else if (gear == 4)
    {
        motorTorque = 4 * (maxMotorTorque / 6);
    }
    else if (gear == 5)
    {
        motorTorque = 5 * (maxMotorTorque / 6);
    }
    else if (gear == 6)
    {
        motorTorque = maxMotorTorque;
    }
}

public float GetRPM()
{
    return RPM;
}

private void RPMCalculations()
{
    if (gear > 0)
    {
        float gearRatio = gearToRatio[gear] * ((rearWheelColliders[0].GetMotorTorque() * 2) + controls.Move.ReadValue<Vector2>().y) * revConstant;
        RPM = rearWheelColliders[0].RPM() * gearRatio;
    }
}

private void Stall()
{
    stalled = false;
    engineRunning = false;
}

private void StallCheck()  // chacks if stalled by looking seeing if rpm goes over a max threshold
{
    if (RPM > stallLimit && !controls.Clutch.IsInProgress() && engineRunning)
    {
        Stall();
    }
}

public float GetRearRPM()
{
    return rearWheelColliders[0].RPM();
}

public float GetRearMotorTorque()
{
    return rearWheelColliders[0].GetMotorTorque() * 2;
}

}

[System.Serializable]
public class Wheel
{
[SerializeField] private WheelCollider wheel;

public Wheel(WheelCollider Iwheel)
{
    wheel = Iwheel;
}

public float RPM()
{
    return wheel.rpm;
}

public void SetMotorTorque(float torque)
{
    wheel.motorTorque = torque;
}

public float GetMotorTorque()
{
    return wheel.motorTorque;
}

public void SetBreakTorque(float torque)
{
    wheel.brakeTorque = torque;
}

public void SetStearAngle(float angle)
{
    wheel.steerAngle = angle;
}

public WheelCollider GetWheelCollider()
{
    return wheel;
}

}