mean -> inverse / solve

need to add comments and test