Added generateAIF function.