Used as a prison During these years, the castle also served as a notorious prison. The castle's bottle dungeon is a dank and airless pit cut out of solid rock below the north-west tower. It housed local miscreants who fell under the Bishop's jurisdiction as well as several more prominent individuals such as David Stuart, Duke of Rothesay in 1402, Murdoch Stewart, 2nd Duke of Albany in 1425, while Archbishop Patrick Graham, who was judged to be insane and might have been imprisoned at this place for a while, actually died in captivity in Loch Leven Castle in 1478. Reformation and siege During the Scottish Reformation, the castle became a centre of religious persecution and controversy. Referring to the bottle dungeon the Scottish reformer, John Knox, wrote, "Many of God's Children were imprisoned here." In 1521 James Beaton, then Archbishop of Glasgow, won the seat of St Andrews and took up residence in the castle. Beaton altered the defences to enable the castle to withstand a heavy artillery attack, which was a threat as tensions grew between English Protestants and Scottish Catholics. A new artillery blockhouse was constructed. In 1538 James Beaton was succeeded by his ambitious and wealthy nephew, Cardinal David Beaton. Much is known about life at the castle from the account book of David Beaton. Beer was brewed by the Widow Fallousdale. In 1541 a whale beached at Byrehills (now Boarhills) was brought to the castle and salted. The Cardinal employed William Blair as a drummer. Onion and lettuce were grown in the castle garden. Two priests, Henry Balfour and James Bykartoun, were masters of work, supervising improvements to the castle and gardens. Christopher Grymmerschere, a French military engineer, provided guns, and Master Wolf made new cannon, and John Fynnyk was the castle gunner. Coal for the castle was shipped from West Wemyss. Three women from Edinburgh and Dunfermline accused of witchcraft were held at the castle and executed by burning on 10 October 1542. Cardinal Beaton's strong opposition to the marriage of Mary, Queen of Scots, with Prince Edward (later King Edward VI), the son and heir of Henry VIII of England, helped to spark renewed fighting in 1544. Scottish Protestants were increasingly viewed as dangerous turncoats who sided with the English. In 1546 David Beaton imprisoned the Protestant preacher George Wishart (1513-1546) in the castle's Sea Tower and had him burnt at the stake in