moving win condition logic to model