main + file output