int primesFoundSoFar is changed from 1 to 2 

In the first for loop the initialization of primesFoundSoFar is 1 which would cause the first prime number of 2 to be overwritten resulting in the first prime number as 3.