Fixed infinite loop. Increased size to 1000 to speed things up a bit.