separate matrix solver