Modified the visible neighbour search

Now it (hopefully) works and is slightly more effective