Changed example to use the io interface