purchase of a gun was in 1384, and the "great bombard" Mons Meg was delivered to Edinburgh in 1457. The first recorded mention of an armoury for the manufacture of guns occurs in 1474, and by 1498 the master gunner Robert Borthwick was casting bronze guns at Edinburgh. By 1511 Edinburgh was the principal foundry in Scotland, supplanting Stirling Castle, with Scottish and European smiths working under Borthwick, who by 1512 was appointed "master melter of the king's guns". Their output included guns for the Scottish flagship, the "Great Michael", and the "Seven Sisters", a set of cannons captured by the English at Flodden in 1513. Sir Thomas Howard, England's Lord Admiral, admired their graceful shape and brilliant finish, declaring them the most beautiful [cannon] for their size and length that he had ever seen. From 1510 Dutch craftsmen were also producing hand culverins, an early firearm. After Flodden, Borthwick continued his work, producing an unknown number of guns, of which none survive. He was succeeded by French smiths, who began manufacturing hagbuts (another type of firearm) in the 1550s, and by 1541 the castle had a stock of 413. Meanwhile, the royal family began to stay more frequently at the Abbey of Holyrood, about from the castle. Around the end of the fifteenth century, King James IV (r.1488–1513) built Holyroodhouse, by the abbey, as his principal Edinburgh residence, and the castle's role as a royal home subsequently declined. James IV did, however, construct the Great Hall, which was completed in the early 16th century. His daughter Margaret Stewart was lodged in the castle with her servant Ellen More. 16th century and the Lang Siege James IV was killed in battle at Flodden Field, on 9 September 1513. Expecting the English to press their advantage, the Scots hastily constructed a town wall around Edinburgh and augmented the castle's defences. Robert Borthwick and a Frenchman, Antoine d'Arces, were involved in designing new artillery defences and fortifications in 1514, though it appears from lack of evidence that little of the planned work was carried out. Three years later, King James V (r.1513–1542), still only five years old, was brought to the castle for safety. Upon his death 25 years later, the crown passed to his week-old daughter, Mary, Queen of Scots. English invasions followed, as King Henry VIII attempted to force a dynastic marriage on Scotland. When the English burnt Edinburgh in