split into separate files for io anddebug so the core program uses no library code