implemented hasSubsequence