implement file output