functions for inverse matrix

code and comments return