little rework of isPrime function/just aesthetic