added functionaity to calculate line intercept