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

Your speedometer most likely needs rebuilt. I am dealing with the same issue. Using the correct gear, speed shows low according to gps speed. If I change the gear to show accurate on the needle it throws the odometer way off. There are two tabs that spin around a wheel which moves the needle.

With the correct gear in your car, google map the distance driven with the odometer and see if it is close.
Working perfect now!