modified primary processing script