IsPrime simplified