added options -d and -q