Defined the prime function.