work on shortest ancestral path