incremental changes to io.py