church ruled that Amalric, and Agnes' children were legitimate and preserved their place in the order of succession. Through her children Agnes would exert much influence in Jerusalem for almost 20 years. Almaric was succeeded by his son by Agnes, Baldwin IV. Almaric's wives, Agnes of Courtenay, now married to Reginald of Sidon, and Maria Comnena, the dowager Queen, who had married Balian of Ibelin in 1177. His daughter by Agnes, Sibylla, was already of age, the mother of a son, and was clearly in a strong position to succeed her brother, but Maria's daughter Isabella had the support of her stepfather's family, the Ibelins. In 1179, Baldwin began planning to marry Sibylla to Hugh III of Burgundy, but by spring 1180 this was still unresolved. Raymond III of Tripoli attempted a coup, and began to march on Jerusalem with Bohemund III, to force the king to marry his sister to a local candidate of his own choosing, probably Baldwin of Ibelin, Balian's older brother. To counter this, the king hastily arranged her marriage to Guy of Lusignan, younger brother of Amalric, the constable of the kingdom. A foreign match was essential to bring the possibility of external military aid to the kingdom. With the new French king Philip II a minor, Guy's status as a vassal of the King and Sibylla's first cousin Henry II of England – who owed the Pope a penitential pilgrimage – was useful. By 1182, Baldwin IV, increasingly incapacitated by his leprosy, named Guy as bailli. Raymond contested this, but when Guy fell out of favour with Baldwin the following year, he was re-appointed bailli and was given possession of Beirut. Baldwin came to an agreement with Raymond and the Haute Cour to make Baldwin of Montferrat, Sibylla's son by her first marriage, his heir, before Sibylla and Guy. The child was crowned co-king as Baldwin V in 1183 in a ceremony presided by Raymond. It was agreed that, should the boy die during his minority, the regency would pass to "the most rightful heirs" until his kinsmen – the Kings of England and France and Frederick I, Holy Roman Emperor – and the Pope were able to adjudicate between the claims of Sibylla and Isabella. These "most rightful heirs" were not named. Baldwin IV died in spring 1185, and was succeeded by his nephew. Raymond was bailli, but he had passed Baldwin V's