g4j31a5, I had guessed that was what you meant, but you only gave part of the solution that wasn't correct by itself.

I think your version is fine if you change the variable name from totalearnings to totalcommisions or something like that to indicate that the value in that array is no longer the total earnings but rather the total commissions. That way, if later you want to do something with the total earnings you won't be confused and get the wrong number.