implement twins and neighbors