modified first ARV code to look at new scratch table