added -o outputfile, updated version