Broken; can't figure out how to write IO function