More code from Matt at UQ towards validation. It runs now, but validation has not been verified at this stage.