fixing up AFC code