clean up miller rabin