Make all these loops one single loop. Loop through machines for all of them. Do the same for the other verb.