commoners likewise lived outside the castle walls. Samurai lived almost exclusively within the compound, those of higher rank living closer to the daimyō's central keep. In some larger castles, such as Himeji, a secondary inner moat was constructed between this more central area of residences and the outer section where lower-ranking samurai kept their residences. Only a very few commoners, those directly in the employ and service of the daimyō or his retainers, lived within the walls, and they were often designated portions of the compound to live in, according to their occupation, for purposes of administrative efficiency. Overall, it can be said that castle compounds contained only those structures belonging to the daimyō and his retainers, and those important to the administration of the domain. Layout The primary method of defense lay in the arrangement of the baileys, called maru (丸) or . Maru, meaning 'round' or 'circle' in most contexts, here refers to sections of the castle, separated by courtyards. Some castles were arranged in concentric circles, each maru lying within the last, while others lay their maru in a row; most used some combination of these two layouts. Since most Japanese castles were built atop a mountain or hill, the topography of the location determined the layout of the maru. The "most central bailey", containing the keep, was called honmaru (本丸), and the second and third were called ni-no-maru (二の丸) and san-no-maru (三の丸) respectively. These areas contained the main tower and residence of the daimyō, the storerooms (kura 蔵 or 倉), and the living quarters of the garrison. Larger castles would have additional encircling sections, called soto-guruwa or sōguruwa. At many castles still standing today in Japan, only the honmaru remains. Nijō Castle in Kyoto is an interesting exception, in that the ni-no-maru still stands, while all that remains of the honmaru is the stone base. The arrangement of gates and walls sees one of the key tactical differences in design between the Japanese castle and its European counterpart. A complex system of a great many gates and courtyards leading up to the central keep serves as one of the key defensive elements. This was, particularly in the case of larger or more important castles, very carefully arranged to impede an invading army and to allow fallen outer portions of the compound to be regained with relative ease by the garrisons of the inner portion. The defenses