Added functions to create an special matrix and invert it