just outside the main walls, the castle mills had become increasingly ineffective from the 16th century onwards because of a reduction in the flow of the rivers driving the water-wheels. as a result, in 1778 they were rebuilt with a new steam engine to drive the machinery; this steam engine caused considerable discomfort to the prisoners affected by the smoke and noise.