protected function getLineageRootIndividual(Individual $indi) {
		$is_first=false;
		$dindi = new \MyArtJaub\Webtrees\Individual($indi);
		$indi_surname=$dindi->getUnprotectedPrimarySurname();
		$resIndi = $indi;
		while(!$is_first){
			//Get the individual parents family
			$fam=$resIndi->getPrimaryChildFamily();
			if($fam){
				$husb=$fam->getHusband();
				$wife=$fam->getWife();
				//If the father exists, take him
				if($husb){
					$dhusb = new \MyArtJaub\Webtrees\Individual($husb);
					$dhusb->isNewAddition() ? $is_first = true : $resIndi=$husb;
				}
				//If only a mother exists
				else if($wife){
					$dwife = new \MyArtJaub\Webtrees\Individual($wife);
					$wife_surname=$dwife->getUnprotectedPrimarySurname();
					//Check if the child is a natural child of the mother (based on the surname - Warning : surname must be identical)
					if(!$dwife->isNewAddition() && I18N::strcasecmp($wife_surname, $indi_surname) == 0){
						$resIndi=$wife;
					}
					else{
						$is_first=true;
					}
				}
				else{
					$is_first=true;
				}
			}
			else{
				$is_first=true;
			}
		}
		if(isset($this->used_indis[$resIndi->getXref()])){
			return null;
		}
		else{
			return $resIndi;
		}
	}