prepare.py order of ifs