also a test for draining files, and expose in main