check matrix, potentially working