Change to take count var into account.