Prime number finder returns false for non-prime numbers

and true for prime numbers