lots of changes, mostly to IO