outputdir can now be specified as second argument.