first time  scan both directions then only x

first time  scan both directions then scan only horizatial