I have to print a list of numbers 1-100 that are all prime. Those prime numbers have to be printed onto a separate .txt file.

```
import java.io.*;
public static boolean isPrime(int number)
{
int division = 0;

if(number<1)
{
  return false;
}

for(division=1; division<=number; division++)
{
  if(number%division==0)
  {
    division+=1;
  }
  if((number%division>2) || (number==1) || (number==-1))
  {
    return false;
  }

}
return true;

```

}

```
public static void main(String[] args) throws IOException
{
  PrintWriter fileToWrite = new PrintWriter("primeNumberList.txt");

  for(int currentNumber=1; currentNumber<=100; currentNumber++)
  {
    if(isPrime(currentNumber))
    {
      fileToWrite.println(currentNumber);
    }
  }
  fileToWrite.close();
  System.out.println("The prime numbers have been listed in the file primeList.txt");
}

```

}

I have this code, whenever I run it will only print the number to. Anything I can do to change it?