use sequence to judge left or right in