invoking the function also sets unInvertedMatrix