TDW update isprime method