Completed search algorithm, found bug in getNeighbours(..)