Umar, in order to house the treasury and serve as an initial residence. Eventually, circa 1126, Ali Ibn Yusuf also constructed a full set of walls, made of rammed earth, around the city in response to the growing threat of the Almohads. These walls, although much restored and partly expanded in later centuries, continue to serve as the walls of the medina of Marrakesh today. The medina's main gates were also first built at this time, although many of them have since been significantly modified. Bab Doukkala, one of the western gates, is believed to have best preserved its original Almoravid layout. It has a classic bent entrance configuration, of which variations are found throughout the medieval period of the Maghreb and Al-Andalus. Elsewhere, the archaeological site of Tasghîmût, southeast of Marrakesh, and Amargu, northeast of Fes, provide evidence about other Almoravid forts. Built out of rubble stone or rammed earth, they illustrate similarities with older Hammadid fortifications, as well as an apparent need to build quickly during times of crisis. The walls of Tlemcen (present-day Algeria) were likewise partly built by the Almoravids, using a mix of rubble stone at the base and rammed earth above. In domestic architecture, none of the Almoravid palaces or residences have survived, and they are known only through texts and archaeology. During his reign, Ali Ibn Yusuf added a large palace and royal residence on the south side of the Ksar el-Hajjar (on the present site of the Kutubiyya Mosque). This palace was later abandoned and its function was replaced by the Almohad Kasbah, but some of its remains have been excavated and studied in the 20th century. These remains have revealed the earliest known example in Morocco of a riad garden (an interior garden symmetrically divided into four parts). In 1960 other excavations near Chichaoua revealed the remains of a domestic complex or settlement dating from the Almoravid period or even earlier. It consisted of several houses, two hammams, a water supply system, and possibly a mosque. On the site were found many fragments of architectural decoration which are now preserved at the Archeological Museum of Rabat. These fragments are made of deeply-carved stucco featuring Kufic and cursive Arabic inscriptions as well as vegetal motifs such as palmettes and acanthus leaves. The structures also featured painted decoration in red ochre, typically consisting of border motifs composed of two interlacing bands. Similar decoration