The problem is that you loop them between 0 and 1, not between 9 and 0.I don't see "0" as "10"
Ah right, yeah I guess it's already implied by that isn't it.
I was hoping the number of objects on each card would help with that, but I guess not.