New I/O

Changes the subroutine structure of the I/O.