Moved array methods to main.js file