Might want to compare cursor position with 0,1,2 and 3 when checking the buttons instead of only 0 and 1 no?

Can you even use cursor position 0? Or does it start at 1?

I think you have them backwards, the units would be at position 3, tens at position 2 and so on.

But yeah, that's a perfect starting point to start building on.

Robert