working on matrix analyzation