extracting data into a array