Move array clone to main.js