Scoreboard player operations

Hey! I´ve been working on a game, where 2 players select a number 1-10, after which, the smaller number gets subracted from the higher one and the result gets added to a score...

Everything seems to be going fine, however for some reason when I choose 7 vs 5 it completely breaks and them math is way off... I feel like i had to missunderstand the operation commands themselves...

I have placed an impulsive command block, which executes if A is higher than B, if so, a chain, conditional command gets run "/execute store result score .white_result marbles run scoreboard players operation .white marbles -= .black marbles", I think this stores the difference then a last command "execute store result score .white_score marbles run scoreboard players operation .white_score marbles += .white_result marbles" Which I think adds the difference to the total score

Im honestly pretty lost, any help is appreciated 🙂

Continue to help post