Write an equation and solve

Joseph spent half the money in his wallet on a video game before earning $10 mowing the lawn. If Joseph’s wallet now has $31, how much was in his wallet before he bought the game?