repleaced miller rabin test with fermat test