Handling large amounts of data with arrays