use pseudoinverse matrix (which is faster but less precise) instead of inverse