Double Jump Not working

//This is the code idk why but it only jumps once but everything seems correct please help me I’m stuck for days

void Update()
{

        //move
        Movement();

        if (IsGrounded())
        {
            Jump();
            canDoubleJump = true;
        }
        else if (canDoubleJump == true)
        {
            Jump();
            canDoubleJump = false;
        }

        void Movement()
        {
            if (Input.GetKey(KeyCode.D))
                rb.velocity = new Vector2(moveForce, rb.velocity.y);
            else if (Input.GetKey(KeyCode.A))
                rb.velocity = new Vector2(-moveForce, rb.velocity.y);
            else
                rb.velocity = new Vector2(0, rb.velocity.y);
        }

        void Jump()
        {

            if (Input.GetKeyDown(KeyCode.Space))
            {
                rb.velocity = new Vector2(rb.velocity.x, jumpForce);
            }
        }
    }

    bool IsGrounded()
    {
        Vector2 position = transform.position;
        Vector2 direction = Vector2.down;
        float distance = 1.0f;

        RaycastHit2D hit = Physics2D.Raycast(position, direction, distance, ground);
        if (hit.collider != null)
        {
            return true;
        }

        return false;
    }

try to add a int which tells your exactly jumpscore like public int jumpsDone and a int wich tells you how much jumps you can do like public int jumpsLeft.

than do this in your grounded function

         if (IsGrounded() || jumpsDone < jumpsLeft)
         {
             Jump()
         }

         if(jumpsDone >= jumpsLeft){
                   if(IsGrounded()){
                            jumpsDone = 0;}

in your Jump function write this

       void Jump()
         {
 
             if (Input.GetKeyDown(KeyCode.Space))
             {
                 jumpsDone++;
                 rb.velocity = new Vector2(rb.velocity.x, jumpForce);
             }
         }

if u have any issues tell me pls

doesn’t work. i cant even jump, what do I need to assign to Ground Check. (I assigned the tile map still doesn’t work)