Added function to calculate winnings.