fixed root ordering bug