added a 3rd argument : datadir. Allows to specify where the data to work on are located