Replaced inverses with solves