public boolean insert(int key) {
    // traverse tree - find where node belongs
    RBNode node	= factory.create();
    RBNode temp	= getRoot();
    
    while(temp != sentinelNode) {	// find Parent
      node.setParent(temp);
      if ( key == temp.getValue()) {
        return false;
      } else if (key > temp.getValue()) {
        temp = temp.getRight();
      } else {
        temp = temp.getLeft();
      }
    }
    
    // setup node
    node.setValue(key);
    node.setLeft(sentinelNode);
    node.setRight(sentinelNode);
    
    // insert node into tree starting at parent's location
    if(node.getParent() != null) {
      if (node.getValue() > node.getParent().getValue()) {
        node.getParent().setRight(node);
      } else
        node.getParent().setLeft(node);
    } else
      setRoot(node); 		// first node added
    
    restoreAfterInsert(node);           // restore red-black properities
    return true;
  }