fixed bugs
finished subsequence search