Homework solved

This function inverts a matrix