made next-prime similar to prev-prime