io.c done. UNTESTED!