changing matrix structure to use LU-SGS