Updated code to provide ability to find inverse of a matrix