Updated for new I/O