Move array into function