public N getCeilingNode(T payload)
  {
    N p = m_root;
    while (p != null)
    {
      int cmp = compare(payload, p.getPayload());
      if (cmp < 0)
      {
        if (p.getLeft() != null)
          p = p.getLeft();
        else
          return p;
      }
      else if (cmp > 0)
      {
        if (p.getRight() != null)
        {
          p = p.getRight();
        }
        else
        {
          N parent = p.getParent();
          N ch = p;
          while (parent != null && ch == parent.getRight())
          {
            ch = parent;
            parent = parent.getParent();
          }
          return parent;
        }
      }
      else
        return p;
    }
    return null;
  }