Update to lin reg code