Update factorizationTools.py