added calculateWait option