In the 5th century, after the Roman empire collapsed, the church took over regulating marriage. At first they did not have a great deal of influence. The Church's power over marriage grew gradually. At first the Church followed Roman civil law. In the ninth century the church raised the number of prohibited degrees to seven. They also changed the method by which they were calculated. The nobility of Europe usually married from within their own social class. Eventually they became too interrelated to marry by the Church's rules. Many found it necessary to defy the Church. In 1215 the Fourth Lateran Council reduced the number of prohibited degrees of consanguinity from seven back to four. The pope had the power to waive the rules for particular couples. Frequently, papal dispensations were given allowing closely related couples to marry. These were almost always reserved for the royalty and nobility. Sometimes the Church used consanguinity to block marriage as in the case of William the Conqueror and Matilda of Flanders. In 1049 Pope Leo IX refused to allow the marriage. He did not give a reason but the two were cousins. They married anyway. Ten years later, in 1059, Pope, Nicholas II finally granted a dispensation for their marriage. Despite restrictions and laws, up to the 20th century consanguineous marriages were not uncommon in Europe.