Early gunpowder weapons were introduced to Scotland by the 1330s. The new technology began to be installed in Scottish castles by the 1380s, beginning with Edinburgh. In the fifteenth century, gunpowder weaponry fundamentally altered the nature of castle architecture. Existing castles were adapted to allow the use of the new weapons by the incorporation of "keyhole" gun ports, platforms to mount guns and walls that were adapted to resist bombardment. Ravenscraig, Kirkcaldy, begun about 1460, is probably the first castle in the British Isles to be built as an artillery fort, incorporating "D-shape" bastions that would better resist cannon fire and on which artillery could be mounted. It also used "letter box" gun-ports, common in mainland Europe, although rarer in England, they rapidly spread across the kingdom. Scotland also led the way in adopting the new caponier design for castle ditches, as constructed at Craignethan Castle.