adding function to compute FK backward in the tree