finished the listPrimes method