Modified validate function slightly, now also collects CVs