The main function of all castles was defense, everything else was secondary. They were always surrounded by a curtain wall, which was often supplemented by a reinforced shield wall at strategic points. Crenellated battlements and arrow slits protected the defenders, and attackers often also had to overcome a series of several gates. The main entrance was protected by a drawbridge and machicolations projecting over the gate, from which boiling liquids and missiles could be dropped on the hapless foes below. The final refuge of the castle residents was the stronghold, or keep. It was the tallest and strongest building within the walls, with a high entrance accessible only via a removable ladder or wooden bridge. In addition to being a watchtower and the centre point of the entire castle, the keep was also a status symbol. The main residential building (great hall) was called the Palas. The castle chapel was often installed in the gatehouse or one of the main towers (nearer my God to Thee!), and a small garden inside the walls provided herbs, flowers and vegetables in emergencies. Offices and service rooms were generally located in the outer ward.