```
private bool isPrime(int num)
{
if (num == 0 || num == 1)
return false;
for (int j = 2; j < num; j++)
{
if (num % j == 0) return false;
}else{
for (int i= 2; j < Math.Sqrt(num); i++)
if (num % j == 0) return false;
}
return true;
}
```

Would this help?