Refactored test to do numbers 1 through 10.
Got tests for 1 to 10 to work. I'm not sure I'm happy with the algorithm, though.