Completed the functions to invert a matrix

Added a sample use