Massively simplified the regression code.