File output works with arrays