fixed diagonal adjacency bug