broken membership algorithm