The reason it does nothing is because your variable $lengthSite has no value and your first for loop looks for $i to be less than $lengthSite and it never is. Once I gave it a value, I then got an error that Maya doesn't know what locate is, but at least it's progress. Good luck.