Took out Thread.sleep() for faster testing.