Almost finish derivative()

I think it's done. Maybe