fixed bugs with neighborhood generation
attempt to fix conflicts: