fixed it so all data is found and goes to flag array