change the code so that results are put in results dir