Josh Fleming

Results 2 issues of Josh Fleming

The `optimize` function is very long, complicated, and hard to follow. We should do two things: - Break it up into smaller functions - Add documentation