using solve instead of inv