Removed Thread.sleep for testing