refactored Elo updating into a function and an assignment.