Added find nth prime functionality