Function that checks if number is a prime number