move inverse matrix calculation to multi-threaded phase, more checks