Thanks, Jozsef Gubicza!
I think you are 100% right. In hindsight, I don’t understand why I didn’t implement it the way that you’re describing (which is definitely more logical). Not enough coffee, I guess :)
I’ll try to go back and edit the article accordingly.