Fixed thread.sleep() placement (I added it to the wrong spot earlier).