perform two loops on different base array. Concatenate results in one array to output.