now  it knows in which box and search in x and y axis