Added tangent line

Got derivative working. The code will need some cleaning.