Fixed problem with the variable father. Now need to check the tree construction.