add randprime; add auto method in genprimes