The Ulug Beg Madrassah was built (1417-1421) by Timur Tamerlane's grandson and stands on the west side of Registan Square in Samarkand. It was a theological school and the building contains cells for the students' living quarters. This gave the courtyard a more domestic role than a mosque court and it probably contained planting, as it does today. The courtyard is now used as a tourist market. The original treatment was lost when the building was used as a grain store in the eighteenth century.