Added wait function

Execution speed