working on matrix equation