Inverse Matrix calculation