refine tracing, work on basic i/o