The first to rule a considerable part of Wales was Rhodri Mawr (Rhodri The Great), originally king of Gwynedd during the 9th century, who was able to extend his rule to Powys and Ceredigion. On his death his realms were divided between his sons. Rhodri's grandson, Hywel Dda (Hywel the Good), formed the kingdom of Deheubarth by joining smaller kingdoms in the southwest and had extended his rule to most of Wales by 942. He is traditionally associated with the codification of Welsh law at a council which he called at Whitland, the laws from then on usually being called the "Laws of Hywel". Hywel followed a policy of peace with the English. On his death in 949 his sons were able to keep control of Deheubarth but lost Gwynedd to the traditional dynasty of this kingdom.