function result = isPrime(x)

    result = true; % flag

    for y = 2 : sqrt(x)
        if mod(x, y) == 0
            result = false;
            break;
        end
    end
end