Turn FoFiX.py into a class, instead of one really long function.