fixed half of the neighbor generating function