new version of io_func and changes to the cycles