private void traverseTree(OperationBase tree, Object parent, Object lastNode, int y)
    {

        if(tree != null)
        {
            if(tree instanceof UnaryOperationBase)
            {
                UnaryOperationBase unary = (UnaryOperationBase) tree;          
                
                Object v2 = graph.insertVertex(parent, null, unary, 30, 2, setWidth(tree.toString()), 40, "DEFAULT");
                
                if(lastNode != null)
                {
                    graph.insertEdge(parent, null, null, lastNode,v2);
                } 
                
                traverseTree(unary.getOperand(), parent, v2, 0);
            }
            
            //end leafs
            else if(tree instanceof ReferencedDataset)
            {                                
                ReferencedDataset ref = (ReferencedDataset)tree;
        
                if(ref.getOperand() != null)
                {
                    traverseTree(ref.getOperand(), parent, lastNode, 0);
                }
                
                else
                {
                    Object v2 = graph.insertVertex(parent, null, tree, 3, 2, setWidth(tree.toString()), 40, "DEFAULT;fillColor=yellow");
                 
                    if (lastNode != null)
                    {
                        graph.insertEdge(parent, null, null, lastNode, v2);
                    }
                }                                            
            }
           
            else if (tree instanceof TupleList) {
                Object v2 = graph.insertVertex(parent, null, tree, 3, 2, setWidth(tree.toString()), 40, "DEFAULT;fillColor=green");

                if (lastNode != null) {
                    graph.insertEdge(parent, null, null, lastNode, v2);
                }
            }
            
            else
            {
                BinaryOperationBase binary = (BinaryOperationBase) tree;
                
                Object v2 = graph.insertVertex(parent, null, binary, 5, 6, setWidth(tree.toString()), 40, "DEFAULT");
                 
                if(lastNode != null)
                {
                    graph.insertEdge(parent, null, null, lastNode,v2);
                } 
                
                traverseTree(binary.getOperandA(), parent, v2, 0);
                traverseTree(binary.getOperandB(), parent, v2, 0);
            }
            
        }

        
    }