You have an orphan REPEAT at line 35. Each REPEAT must have a matching UNTIL.