linear regression added, refactored the code