implement state and neighbors