add suffix if directory already exists

Hi Richard,
As you can see we are practicing the topic branches here :) This is a small change to the output directory. We add a suffix (e.g. _1, _2 etc) if the dircetory name already exists.
Cheers, Kathi