Implemented way to automatically adjust the wait time.
Fixed logic rules.