added win/lose functions