ENH: edited the function calls and the IO procedure