Added Checks for Squate Matrix and Invertible