Add function find_common_ancestor and function to print subtree