My modifications

Inverse Matrix calculation  based on function calling based on whether
inverse already exists or not.