**Tell us what’s happening:**

this code works well for small value inputs but for the large values it is not working

**Your code so far**

```
function checkprime(i,numo)
{
var count=0;
for(var j=1;j<numo;j++)
{
if(i%j==0)
count++;
}
if(count==2)
return 1;
return 0;
}
function sumPrimes(num) {
var sum=0;
for(var i=1;i<=num;i++)
{
if(checkprime(i,num))
sum+=i;
}
return sum;
}
sumPrimes(977);
```

**Your browser information:**

Your Browser User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0`

.

**Link to the challenge:**

https://www.freecodecamp.org/challenges/sum-all-primes