How to find minors of matrix