Adapted code to the FIO