made pseudoinvert more user friendly