result data extracted.  need to combine the loops