In the 16th century the northern fringe of the Sahara, such as coastal regencies in present-day Algeria and Tunisia, as well as some parts of present-day Libya, together with the semi-autonomous kingdom of Egypt, were occupied by the Ottoman Empire. What kind of rule did the kingdom of Algeria have?