fixed building the tree and finding the longest recurring cycle ( matchingCharsCnt didn't break when there was mismatch and later in the strings matches were found )