count will contain the number of the current search type

while(!found && (ptr != null))