For future reference, please use the code tags (see my sig for instructions).

There seems to be a logic problem with you assertions:


assert (neighbour=null) : "null neighbour in Check if have...