implemented miller rabin