redid sequence matcher to be simpler