Modified to reuse count.