making code use sleep