third algorithm of finding tags correlation added