Win and lose logic implemented