modelled the io example