rough first version for customizable output file name
use customizable output file name