Secant Becoming Tangent

This code generates a sequence of frames which can be animated to show a secant line approaching the tangent line to a user-supplied curve.  In the example shown, the function is y = x^3, and the point of tangency is (1,1).

f[x_] = Input["Enter the function whose tangent line 
		is desired:"];
pr = Input["Enter the plotrange in the form 
		{{xmin,xmax},{ymin,ymax}}:"];
x1 = Input["Enter the x-coordinate of the point of 
		tangency:"];
x0 = Input["Enter the initial x-value for the secant lines:"];
steps = Input["Enter the number of steps:"];
g[x_] = f'[x];
curve = Plot[f[x],{x,pr[[1,1]],pr[[1,2]]},PlotRange->pr,
	PlotStyle->{{RGBColor[.14,.56,.14],Thickness[.0075]}},
	DisplayFunction->Identity];
tanline = Plot[f[x1] + g[x1](x-x1),{x,pr[[1,1]],pr[[1,2]]},PlotRange->pr,
	PlotStyle->{{RGBColor[0,0,1],Thickness[.0075]}},
	DisplayFunction->Identity];
Clear[j];
Do[If[j<steps,
		(m = (f[x1]-f[x0+j(x1-x0)/steps])/(x1-(x0+j(x1-x0)/steps));
		  sec = Plot[f[x1]+m(x-x1),{x,pr[[1,1]],pr[[1,2]]},PlotRange->pr,
				PlotStyle->{{RGBColor[.2,.6,.8],Thickness[.0075]}},
				DisplayFunction->Identity];
		  Show[curve,sec,
		   		Graphics[{RGBColor[1,0,0],PointSize[.02],
					Point[{x0+j(x1-x0)/steps,f[x0+j(x1-x0)/steps]}],
					Point[{x1,f[x1]}],
					RGBColor[1,0,0],
    				Text[StringForm["slope = ``",N[m,4]],
    	   				{x1+.2,f[x1]},{-1,0}]}],
    	  PlotRange->pr, DisplayFunction->$DisplayFunction]),
    	  
    	   (Show[curve,tanline,
		   		Graphics[{RGBColor[1,0,0],PointSize[.02],
					Point[{x1,f[x1]}],
    				Text[StringForm["slope = ``",N[g[x1],4]],
    	   				{x1+.2,f[x1]},{-1,0}]}],
    	  PlotRange->pr, DisplayFunction->$DisplayFunction])],
 {j,0,steps}]