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

is there more than one mopar speedometer gear housing? most are 26-45. but you said you had a 23 tooth gear originally.

what size is your tire 295r1595s does not compute
My mistake. The driven gear I pulled was a 27T ... The rear tire size is P225/60R15