added -d option and docs