tries different combination of directories