I'm no scripting God myself, but just a two things which seem out of place to me:
- In @t2y and @t3y you've set the flags as 201, in @t4y you've used 0x201. Should all be 0x201, if I'm correct (as your checkflag also points to 0x201).
- I'm not quite sure if @t2-1 is a valid name, really...