Please explain numUnique()

template<typename T>
List<T>::iterator seqSearch(List<T>::iterator first, List<T>::iterator       last, const T& target) {
list<T>::iterator iter = first;
while(iter != last &&(*iter != target) {
    iter++;
return tier; }

template<typename T>
int numUnique(list<T>& aList) {
list<T>::iterator iter, iterNext;
int uniqueCount = 0;

iter = aList.begin();
while(tier != aList.end()) 
{
    if(seqSearch<T>(aList.begin(), iter, *iter) == iter) {
        iterNext = iter;
        iterNext++;
        if(seqSearch<T>(iterNext, aList.end(), *iter) == aList.end())
            uniqueCount++;
    }
    iter++;
}
return uniqueCount;

} Here is the code in a more readable format code Sorry for the poorly formatted code but the editor was being a PITA Can someone please explain what is happening in the while loop? A detailed or brief explanation would be perfect. Thanks!