refactor checkforwinner