bug fixed

- inactive index set added
- A[j] <-> j in some places