Wrote function for inverse matrix
Updated code for inverse matrix function