Find the adjacent cell in a more intelligent way