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

I recently installed a new speedometer cable and the mph readings were off by 20-30 plus mph. Called Mancini Racing, gave them my tire size (P225R1595S) along with the rear end gear size (3.91) and was told I needed to install a 40 tooth driven gear, which I purchased and installed. (The old gear I replaced was a 23 tooth). It still seemed off so I used the speed app on my phone and now reads accurate to 10 mph and then jumps the speedometer reading 10-13 mph OVER my actual speed when driving faster than 15 mph. Is there a rule of thumb for speedometer speed readings per gear tooth? Do I need a 42-44 driven gear instead of the 40 tooth? Any thoughts? Thanks in advance... UPDATE. Issue Fixed! Working perfectly now. Thank you to all who helped with advice...