removed sleep commands where possible