Question: I have been working on this for hours now and can't figure out even how to diagnose this issue. When I run this code and step through it, I get an AuthenticationManager class initated but when it goes to create the client context, It just hangs. No error, No break, No exception. Sits there and idles forever.

Thanks for the help, this has been driving me crazy for way to long.

Here is my code (Personal Information has been changed obviously)

```
public static class SharepointAPI
{
    private static ClientContext cc { get; set; }

    private static void GenVar()
    {
        if(cc == null)
        {
            string appId = "a9f346f5-7229-4127-bfa2-7605c4593ca6";
            var scopes = new string[] { "https://contoso.sharepoint.com/.default" };
            string siteURL = "https://contoso.sharepoint.com/sites/HR/";
            string tenant = "contoso.onmicrosoft.com";
            string certpath = Directory.GetCurrentDirectory() + "\\cert.pfx";
            string certpass = @"Password123";
            var certificate509 = GetCertificate(certpath, certpass);
            cc = new PnP.Framework.AuthenticationManager(clientId: appId, certificate: certificate509, tenantId: tenant)
                .GetContext(siteURL);

        }
        else
        {
            return;
        }    
    }
    private static X509Certificate2 GetCertificate(string filename, string pwd)
    {
        var certificate = new X509Certificate2(filename, pwd);
        return certificate;
    }

```

Answer: 
Looks like the site only allows you to have the function and nothing else. Specifically in this situation: no separate functions. So if I put your `checkPrime` function inside `myFunction` it will pass successfully.

```js
function myFunction(number) {
  function checkPrime(number) {
    for (var i = 2; i < number; i++) {
      if (number % i === 0) {
        return false;
      }
    }
    return true;
  }
  if (checkPrime(number)) {
    return number;
  } else {
    while (checkPrime(number) === false) {
      number++;
    }
  }
  return number;
}

```
```
function myFunction(a) {
  for (let i = 2; i < a; i++) {
    if (a % i === 0) {
      return myFunction(++a);
    }
  }

  return a;
}

```