wrote tests for io sampling
implemented io sampling