inverse method works for real and complex matrices now