implemented done and neighboursWithHistory