applied fantinel's changes to pushd, improved checkdupl adding optional sleep per cycle