Finished and tested iofunctions