adding IO stuff, have to change to non-blocking