Handling large amount of data with arrays