improving waitFor examples