Added a smarter mechanism for determining which simulations need to keep datasets and which don't need to.