Complete fix of neighbors().
Add assert.
Implement the critical optimization.
Fix bugs fund by the autograder.