The death of Mael Coluim, son of Mael Brigte, is recorded in 1029 and, in 1032 that of his brother Gilla Comgain, killed along with 50 of his men. Gilla Comgain's successor and probably also his killer, was his cousin Macbeth (Mac Bethad mac Findlaig). Macbeth married Gilla Comgain's widow Gruoch, a princess of the mac Alpin dynasty, and became king of Scots in 1040, after defeating and killing Duncan I of Scotland (Donnchad ua Mail Choluim) in battle. Later sources suggest that MacBeth had a claim to the Scottish throne through his mother, but his Gaelic pedigree, on record only two generations after his death, traces his descent through his father Findlaech, and grandfather Ruaidri, from the house of Loarn, Kings of Dál Riata. The pedigree of Macbeth from the Loarn kings of Dál Riata offers a clue to the origins of his dynasty in Moray. Moray may have been a separate kingdom for a time, independent of the dynasty of Kenneth mac Alpin. However it seems likely that rulers of Moray were subject loosely to the Kings of Alba. Moray acted as a buffer against further Scandinavian penetration from the north, and its rulers were remembered with respect in Scandinavian sources such as "Orkneyinga Saga". Macbeth himself was in turn killed and defeated in 1057. After which, his stepson Lulach, son of Gilla Comgain, and presumably also of Gruoch, claimed the Scottish throne briefly before being himself killed in 1058. Lulach's son, Mael Snechtai, died in 1085 as 'king of Moray'. Later, an earl named Aed or 'Heth' who witnesses royal charters early in the next century may also have been based in Moray. The last ruling member of the dynasty, styled 'king' or 'earl' of Moray, was Óengus (Angus) son of the daughter of Lulach. Óengus (Angus) challenged David I of Scotland in battle, but was defeated and killed at Stracathro in Angus, in 1130 and thus the Kingdom of Moray was destroyed by David I of Scotland. With the death of Angus brought the rapid feudalisation of Moray under Flemming Freskin, who was of Flemish and Norman descent and his descendants who adopted the significant designation 'de Moravia', which means 'of Moray'.