added functionality to balance and bet
added win-lose conditions
refactoring