replaced speedometer driven gear with recommended 40 tooth and still not accurate...

If you have a Smart phone, go to the APP store & get a speedo app. Put the phone on your dash & compare what it reads, versus your speedo. Then you will know how far off it is.
Did that last night. Spped is spot on until 25 mph then slowly reads faster than actual speed up from there. Example: 30 mph on gps reads 35mph on speedometer. 70 mph on speedometer reads 57 on gps. The odometer however is SPOT ON. Our highways are one mile apart and the odometer was dead nuts on. I don't know what's going on..