diff --git a/run.sh b/run.sh
index 8641b43fb7a920882e2b8180427b801cd272e81f..7cd3d64eb8e3095d27d4df1f4ab619602fee180b 100755
--- a/run.sh
+++ b/run.sh
@@ -1,11 +1,11 @@
 #!/bin/bash
 ## A short shell script to test the current development version of Persephone.
 
-if [[ -d "test_results" ]]
+if [[ -d "temp_results" ]]
 then
-    rm -r test_results
+    rm -r temp_results
 fi
 
-./run.jl -o test_results -s 2
+./run.jl -o temp_results -s 2
 
-src/analysis/analyse_nature.R
+src/analysis/analyse_nature.R temp_results
diff --git a/src/analysis/analyse_nature.R b/src/analysis/analyse_nature.R
index 8b2f275a6536791d96e9f93e58206eac2f1cb261..c176b9fe62834a04197384fcf44d12a79c859f08 100755
--- a/src/analysis/analyse_nature.R
+++ b/src/analysis/analyse_nature.R
@@ -12,7 +12,7 @@ library(terra) #https://rspatial.github.io/terra/index.html
 
 autorun = TRUE ## automatically run all analyses?
 
-datadir = "test_results" ## "results" by default
+datadir = "results" ## "results" by default, can be specified via commandline
 popfile = "populations.csv"
 indfile = "individuals.csv"
 mapfile = "landcover_jena.tif"
@@ -58,14 +58,10 @@ visualiseMap = function() {
 
 ## If autorun is set, run the experiment specified via commandline argument
 if (autorun) {
+    ## the last commandline argument is interpreted as the output directory
+    ##TODO make map files configurable
+    arg = commandArgs()[length(commandArgs())]
+    if (dir.exists(arg)) datadir = arg
     populationTrends()
     visualiseMap()
-    ##TODO set variables from commandline arguments
-    ## arg = commandArgs()[length(commandArgs())]
-    ## if (arg %in% c("tolerance", "habitat", "mutation", "linkage","tolerance_long")) {
-    ##     experiment = arg
-    ##     results = loadData(experiment)
-    ##     plotAll(results)
-    ## }
-    ## else { print(paste("Unknown experiment" , arg)) }
 }