implement neighborhood size