Removed Thread.sleep() as it is apparently bad practice.