renamed outfile -> outname