You can do this easily with families, but it's harder without. Just store the couple of data points you need in some local variables in your first foreach (include the UID), then pick all again, then pick all BUT the saved UID (to get all other cars) and test against the locals. You may want to add some extra code to prevent testing twice, but this should get you started.