use last occurence of -d and -D, closes #35