added previousPrime + fixed nextPrime