improved -d option