Update factor.py