Rewrote convert.py to be more modular