Changed the counter N in calculatePrimes() to j

N is just a counter, it makes more sense to name it j. Apart from that, the switch from upper case to lower case needed to be done. 
Moreover, instead of having j = j + 1 (on line 62), it's easier to just use j++.