added win condition, flags
added lose, fixed flagging,