Runable version to generate factors