added -h and -d