Be aware that the coding error I pointed out is still in place and you need to address the use of $datas...
Should just need to remove the 's.
Otherwise when you get to the foreach loop you will go through every instance of $datas that is currently in memory. So the first time you will iterate through just one value of $datas but the second time you will have the same value as you had the first time as well as the new second value and the third time through will have the first two and an additional. Plus when you send your array to setVars you will have the whole array you just setup sent to it instead of each item.
Removing the 's should get the foreach loop to work as intended.
Should step through the contents of $datas and send each entry to setVars.