edited the getFile function so it organises the array into a feasible size