optimizer.py now works and is pretty