This method returns true if the number is a prime number. Simply, it checks all the numbers up to the numbers square root and returns false if the number is divisible by any, otherwise returns true.