Spike algo

Don't commit; halfway through critical TDD refactoring