What is happening is that the commission variable is being replaced by each new user entry.

When it comes to totalling the average commission, it uses the most recent entry (commission) instead of...