Much improved means of checking for existing data.