The castle was originally constructed as a motte and bailey, by William the Conqueror during the 1070s-80s, as part of a chain of defences designed to protect London. It comprises a motte with a large bailey on either side. Henry I used the castle as a royal residence and it became a palace during the reign of Henry II. The collegiate chapel of St Edward the Confessor, which stood East of the Chapel of St George,was collegiate from circa 1130-1348, when it was replaced by St Georges Chapel. A hospital and chantry chapel were associated with the secular colleges, but an almshouse provided for in Edward IVs will was probably not created. Henry II was responsible for the first major programme of rebuilding in 1165-71 when parts were rebuilt in stone. Further rebuilding took place during the reign of Henry III when the castle became one of three principle royal palaces. Additions to the castle during the reign of Edward III included the rebuilding in Gothic style of the Lower and Upper Wards. St Georges Chapel was built in the reign of Edward IV. A major programmme of rebuilding took place after the Civil War, from 1660 to 1685 which included the construction of the State Apartments and rebuilding of the Upper Ward in baroque style. Further alterations also took place in the 1780s-90s. Alterations between 1823-35 included the raising of the Round Tower by 30 feet, and rebuilding of all external facades of the Upper Ward in Gothic style. Minor alterations to the castle took place thoughout Queen Victorians reign. Parts of the castle, including St Georges Hall, the Private chapel and Brunswick Tower were damaged by fire in 1992. A programme of restoration was completed in 1997.