Added an nth prime function