Moved array functions to separate file