Added comments and created fn to get and return matrix inverse