The table element specified by the TO subscript precedes that specified by the FROM subscript.
Recode your program.