Finger print sensor.

I have already enroled five finger prints stored in the scanner with ID's 1,2,3,4 and 5.

In my program i can declare an array to hold a copy of the ID's.

int finger[5] = {1,2,3,4,5};

if(fingerID > 0)
{

// what can I do here to achieve the below


}

the procedure can be like this

initialise a counter maybe to 0.
Scan any finger
if the ID corresponds to any ID in the array, we increement a counter to 1 else do nothing
scan any finger again,
if the ID corresponds to any ID in the array and different from first scanned finger, increament counter to 2, else wait for for finger.

if counter == 2, then light led.

This is in summary what I want to do but I have trouble comparing with the arrays and the first finger on seconde scan.
If you can provide a piece of code that can perform function, I will be grateful.