Added some logic to betting