Why is there a Thread.sleep() here? I don't quite follow this.