Convert data to array