Implemented multiprocessing for rulegen.