public void add(int element){      
    IntBTNode cursor = root;
    IntBTNode node = new IntBTNode(element, null, null);
    boolean done = false;
    
    if(root == null){//creates the first node and it is the root
        root = new IntBTNode(element, null, null);
        System.out.println("element of root = " + element);
    }else{

        while(!done){
            if(element < cursor.getData())
            {//then focus on the left
                if(cursor.getLeft() == null)
                {//if null then creates a node
                    cursor.setLeft(node);
                    done = true;
                }else
                {//then continue going through node until cursor.getLeft == null
                    cursor = cursor.getLeft();
                }
            }else{//focus on the right
                if(cursor.getRight() == null)
                {
                    cursor.setRight(node);
                    done = true;
                }else
                {
                    cursor = cursor.getRight();
                }
            }
        }//end while   
    }   
 }