complete liner regression implementation