rewriting _relative() to allow prev/next through the entire tree