added "fname" keyword for file output (can be list)