Implemented neighborhood queries.