Finished rewriting fix.py