split into 3 files, form instead of table, detects end, no AI