fix bug in ICG definition and start rref() in matrix.py