Some more work on refactoring exchange table. Most done, just need to write algorithm now.