writing to file, not stdout