The middle platform was also configured for cannon firing. In the years 1539 – 1543 John of Dubovec built a five-story palace in the empty space between the tower and the stone wall of the Upper Castle. The Turkish threat was the reason for building these new fortifications. A new gate with a ditch and drawbridge in the Lower Castle was completed in 1543. The Tower of the Archives was built against the castle walls.