Working version of miop_to_fiop