Performance improved in neighbor search function;
strict mode enabled;
Removed useless check