Reworked neighborhood enumeration