fixes syntax errors; corrects x/y mismatch in check4winner()