finished all the logic to find neighbours