added lin reg function