Pack data into an array