added algorithms to find ancestors in BT