supports multi file output or single file output