working on moving the I/O handling over to a seperate module