loop over multiple arrays simultaneously