Major changes, to try to get linreg working for live data